package com.spark.gaea.utils.exception;

import com.spark.gaea.core.ApiErrorCode;

public class ApiException extends GaeaRuntimeException {
	private ApiErrorCode errorCode;
	private String message;

	public ApiException() {
		this.errorCode = ApiErrorCode.INTERNAL_ERROR;
		this.message = null;
	}

	public ApiException(final String message) {
		this.errorCode = ApiErrorCode.INTERNAL_ERROR;
		this.message = message;
	}

	public ApiException(final ApiErrorCode errorCode, final String message) {
		this.errorCode = errorCode;
		this.message = message;
	}

	public ApiException(final ApiErrorCode errorCode, final String message, final Throwable cause) {
		super(message, cause);
		this.errorCode = errorCode;
		this.message = message;
	}

	public ApiErrorCode getErrorCode() {
		return this.errorCode;
	}

	public void setErrorCode(final ApiErrorCode errorCode) {
		this.errorCode = errorCode;
	}

	public String getMessage() {
		return this.message;
	}

	public void setMessage(final String message) {
		this.message = message;
	}
}
